<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>IDC工单登记平台</title>
    <meta name="keywords" content="IDC工单登记平台">
    <meta name="description" content="IDC工单登记平台">
    <link rel="stylesheet" href="/static/css/gdsc/mian.css" type="text/css" media="screen" />
</head>
<body onload="onload()">
    <div class="head"></div>
    <div class="entry-container-inner">

        <div>
            <form  class="ant-form  published-form__container  border box-shadow" style="max-width: 700px; background-color: rgba(255, 255, 255, 0.5); border-color: rgb(170, 178, 189); border-width: 0px;">
                <div class="form-header__banner" style="text-align: left; background-color: rgb(40, 117, 232);">
                    <img src="/static/images/gdsc/20200422163342_ef3e49" alt="">
                </div>
                <div class="form-header__container">
                    <div class="form-header__title" style=" text-align: left; font-family: inherit; font-size: 20px; font-weight: bold; color: rgb(51, 51, 51);">IDC工单登记表</div>
                    <div class="field__description" >
                        <p>
                            请您认真填写报表所需信息，不要有任何遗漏或者错误，谢谢配合!
                            <br>
                            &nbsp;
                            <br>
                            &nbsp;
                        </p>

                    </div>
                </div>
                <div class="published-form__body" style="border-color: rgb(195, 201, 208);">
                 <form >
                   {% if news.zb and news.zb == "5*8时间段工单" %}
                      <input style="width: 20px;height: 20px;vertical-align:middle;margin: auto;" type="radio" name="sex"   id="gd-time" checked value="5*8时间段工单"><p style="display: inline-block; line-height: 20px;padding: 20px 5px;">5*8时间段工单</p>
                      <input style="width: 20px;height: 20px;vertical-align:middle;margin: auto;" type="radio" name="sex" id="gd-time" value="非5*8时间段工单"><p style="display: inline-block;line-height: 20px;padding: 20px 5px;">非5*8时间段工单</p>
                     <input style="width: 20px;height: 20px;vertical-align:middle;margin: auto;" type="radio" name="sex" id="gd-time" value="紧急工单"><p style="display: inline-block;line-height: 20px;padding: 20px 5px;">紧急工单</p>
                     {% elif news.zb == "非5*8时间段工单"%}
                      <input style="width: 20px;height: 20px;vertical-align:middle;margin: auto;" type="radio" name="sex"   id="gd-time"  value="5*8时间段工单"><p style="display: inline-block; line-height: 20px;padding: 20px 5px;">5*8时间段工单</p>
                      <input style="width: 20px;height: 20px;vertical-align:middle;margin: auto;" type="radio" name="sex" id="gd-time" checked value="非5*8时间段工单"><p style="display: inline-block;line-height: 20px;padding: 20px 5px;">非5*8时间段工单</p>
                     <input style="width: 20px;height: 20px;vertical-align:middle;margin: auto;" type="radio" name="sex" id="gd-time" value="紧急工单"><p style="display: inline-block;line-height: 20px;padding: 20px 5px;">紧急工单</p>
                     {% elif news.zb == "紧急工单"%}
                      <input style="width: 20px;height: 20px;vertical-align:middle;margin: auto;" type="radio" name="sex"   id="gd-time"  value="5*8时间段工单"><p style="display: inline-block; line-height: 20px;padding: 20px 5px;">5*8时间段工单</p>
                      <input style="width: 20px;height: 20px;vertical-align:middle;margin: auto;" type="radio" name="sex" id="gd-time" value="非5*8时间段工单"><p style="display: inline-block;line-height: 20px;padding: 20px 5px;">非5*8时间段工单</p>
                     <input style="width: 20px;height: 20px;vertical-align:middle;margin: auto;" type="radio" name="sex" id="gd-time" checked value="紧急工单"><p style="display: inline-block;line-height: 20px;padding: 20px 5px;">紧急工单</p>
                     {% else %}
                     <input style="width: 20px;height: 20px;vertical-align:middle;margin: auto;" type="radio" name="sex"   id="gd-time"  value="5*8时间段工单"><p style="display: inline-block; line-height: 20px;padding: 20px 5px;">5*8时间段工单</p>
                      <input style="width: 20px;height: 20px;vertical-align:middle;margin: auto;" type="radio" name="sex" id="gd-time" value="非5*8时间段工单"><p style="display: inline-block;line-height: 20px;padding: 20px 5px;">非5*8时间段工单</p>
                     <input style="width: 20px;height: 20px;vertical-align:middle;margin: auto;" type="radio" name="sex" id="gd-time" value="紧急工单"><p style="display: inline-block;line-height: 20px;padding: 20px 5px;">紧急工单</p>

                   {% endif %}


                 </form>
                <form >
                   {% if news.jj and news.jj == "非紧急工单" %}
                      <input style="width: 20px;height: 20px;vertical-align:middle;margin: auto;" type="radio" name="sex1"   id="gd-time" checked value="非紧急工单"><p style="display: inline-block; line-height: 20px;padding: 20px 5px;">非紧急工单</p>
                      <input style="width: 20px;height: 20px;vertical-align:middle;margin: auto;" type="radio" name="sex1" id="gd-time" value="紧急工单"><p style="display: inline-block;line-height: 20px;padding: 20px 5px;">紧急工单</p>
                     {% elif news.jj == "紧急工单"%}
                     <input style="width: 20px;height: 20px;vertical-align:middle;margin: auto;" type="radio" name="sex1" id="gd-time" value="非紧急工单"><p style="display: inline-block;line-height: 20px;padding: 20px 5px;">非紧急工单</p>
                    <input style="width: 20px;height: 20px;vertical-align:middle;margin: auto;" type="radio" name="sex1" id="gd-time" checked value="紧急工单"><p style="display: inline-block;line-height: 20px;padding: 20px 5px;">紧急工单</p>
                     {% else %}
                      <input style="width: 20px;height: 20px;vertical-align:middle;margin: auto;" type="radio" name="sex1" id="gd-time" value="非紧急工单"><p style="display: inline-block;line-height: 20px;padding: 20px 5px;">非紧急工单</p>
                     <input style="width: 20px;height: 20px;vertical-align:middle;margin: auto;" type="radio" name="sex1" id="gd-time" value="紧急工单"><p style="display: inline-block;line-height: 20px;padding: 20px 5px;">紧急工单</p>

                   {% endif %}


                 </form>
                   <div style="padding-bottom: 5px;">工单链接（或邮件）</div>
                   <div><input type="text" id="gd-link" value="{{ news.gname }}"></div>
                   <div style="padding-top: 15px;padding-bottom: 5px;">工单类型</div>
                   <div class="search">
                    <input id="input" type="text"  onfocus="showDiv()" oninput="filterP()" value="{{ news.dc.fname }}|计算单位:{{ news.dc.cunit }}">
                    <div id="dataList" class="content" onclick="pushInput()" style="display:none;">
                      {% for one_ser in dcs %}

                        <p>{{ one_ser.fname }}|计算单位:{{ one_ser.cunit }}</p>

                      {% endfor %}
                    </div>
                   </div>
                   <div style="padding-top: 15px;padding-bottom: 5px;">工作量</div>
                   <div><input type="text" id="gd-number" value="{{ news.gcount }}"></div>

                </div>

            </form>
            <div  style="padding: 30px 0 70px  0;" ><button style=" display: block;margin: auto; padding: 5px 55px; background-color: rgb(0, 156, 187); border-color: rgb(255, 255, 255); border-width: 0px; font-family: inherit; font-size: 14px; font-weight: normal; color: rgb(255, 255, 255); box-shadow: rgba(0, 0, 0, 0.2) 0px 0px 1px;"  id="gd-pub" data-news-id="{{ news.id }}">确认修改</button></div>
            <div  style="padding: 30px 0 70px  0;" ><button style=" display: block;margin: auto; padding: 5px 55px; background-color: rgb(0, 156, 187); border-color: rgb(255, 255, 255); border-width: 0px; font-family: inherit; font-size: 14px; font-weight: normal; color: rgb(255, 255, 255); box-shadow: rgba(0, 0, 0, 0.2) 0px 0px 1px;"  id="qx-pub" >取消修改</button></div>
            <footers style="text-align: center ;">

                <p>
                    杭州研究院 - 技术工程事业部 - 网络管理中心 - IDCS组
                    <br>
                    &nbsp;

                </p>


            </footers>
        </div>

    </div>
    <script src="{% static 'js/base/jquery.min.js' %}"></script>
    <script src="{% static 'js/admin/gdsc/xgupdate.js' %}"></script>
    <script src="{% static 'js/base/message.js' %}"></script>
    <script>
      var dataArr = [];
        var dataList = document.getElementById('dataList');
        function onload() { //初始化dataArr的数据
         var childs = dataList.children; //在IE下注释也算节点,不能用于
         for (var i = 0; i < childs.length; i++) {
          dataArr.push(childs[i].innerText);
         }
         console.log(dataArr);
        }
        function showDiv() {
         dataList.style.display = "";
        }
        function filterP() {
         var e = event.target || event.srcElement;
         var str = e.value;
         console.log(str);
         dataList.innerHTML = ''; //清空div下的所有P元素
         dataArr.forEach(function (item) {
          if (item.indexOf(str) != -1) {
           var p = document.createElement('p');
           var text = document.createTextNode(item);
           p.appendChild(text);
           dataList.appendChild(p);
          }
         })
         console.log("dataList.innerHTML：" + dataList.innerHTML)
         if (dataList.innerHTML == '') {
          var p = document.createElement('p');
          var text = document.createTextNode('暂无数据');
          p.style.color = 'red';
          p.onclick = function () { event.stopImmediatePropagation(); } //阻止事件的冒泡
          p.appendChild(text);
          dataList.appendChild(p);
         }
        }
        function pushInput() { //利用事件委托机制,获取点击的P源
         var e = event.target || event.srcElement;
         var input = document.getElementById('input');
         input.value = e.innerText;
         dataList.style.display = 'none';
        }
    </script>
</body>
</html>



